<template>
  <div>
    <ul>
      <li v-for="i in list">{{i.name}}</li>
    </ul>
    <page :total="total" @currentP="getcurrent"/>
  </div>
</template>
<script>
import page from "./page";
export default {
  name: "catelist",
  components:{
    'page':page
  },
  data(){
    return{
      list:[],
      total:0,
      page:1
    }
  },
  methods:{
    getlist(){
      this.axios.get('pagecates?page='+this.page).then(res=>{
        this.list=res.data.list
        this.total=res.data.total
      })
    },
    getcurrent(v){
      this.page=v
      this.getlist()
    }
  },
  mounted() {
    this.getlist()
  }
}
</script>

<style scoped>

</style>
